/*
 * Copyright 2014 Semidata. All rights reserved.
 */
package com.semidata.rtd.engine.main;

import com.semidata.rtd.core.redis.RedisClient;
import com.semidata.rtd.core.service.ServiceManager;
import com.semidata.rtd.engine.executor.TaskExecutor;

/**
 * @author shewei@semidata.com, She Wei
 * 
 */
public class Main {

	public static void main(String[] args) {
		
		String[] addrs = new String[16];

		for (int i = 0; i < 16; i++) {
			addrs[i] = args[0] + ":" + (6379 + i);
		}

		ServiceManager.register(new Monitor());
		ServiceManager.register(new RedisClient(addrs, addrs.length, 1, 1000));
		ServiceManager.register(new TaskExecutor(16));
		ServiceManager.register(new TestService(Integer.valueOf(args[1]), Integer.valueOf(args[2])));
		
		ServiceManager.startAll();
		ServiceManager.sync();
	}

}
